package com.eugene.ui.util;

import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.internal.views.properties.PropertiesMessages;
import org.eclipse.ui.views.properties.IPropertySheetPage;
import org.eclipse.ui.views.properties.PinPropertySheetAction;
import org.eclipse.ui.views.properties.PropertySheet;

import de.ralfebert.rcputils.builder.ctxmenu.ContextMenuBuilder;

public class CustomProperyView extends PropertySheet {
//	@Override
//	protected boolean isImportant(IWorkbenchPart part) {
//		// if
//		// (part.getSite().getId().equals("com.eugene.ui.editors.IrCurveEditor")){
//		if (part.getSite().getId().equals(
//				"com.eugene.ui.views.MarketVariableView")) {
//			return true;
//		}
//		return false;
//	}
	
	@Override
	public void createPartControl(Composite parent) {

		super.createPartControl(parent);
//		IMenuManager menuManager = getViewSite().getActionBars()
//				.getMenuManager();
//		IContributionItem[] items = menuManager.getItems();
//		for (IContributionItem iContributionItem : items) {
//			if (iContributionItem instanceof ActionContributionItem) {
//				if (((ActionContributionItem) iContributionItem).getAction() instanceof PinPropertySheetAction) {
//					menuManager.remove(iContributionItem);
//					break;
//				}
//			}
//		}
//		IToolBarManager toolBarManager = getViewSite().getActionBars()
//				.getToolBarManager();
//		items = toolBarManager.getItems();
//		for (IContributionItem iContributionItem : items) {
//			if (iContributionItem instanceof ActionContributionItem) {
//				if (((ActionContributionItem) iContributionItem).getAction() instanceof PinPropertySheetAction) {
//					toolBarManager.remove(iContributionItem);
//					break;
//				}
//			}
//		}
	}

//	@Override
//	public boolean isPinned() {
//		return false;
////		return true;
//	}
	
}
